﻿@inject ModalService _modalService

<Button OnClick="@ShowConfirm">Confirm</Button>

@code {

    private Func<MouseEventArgs, Task> OnOkClick = async (e) =>
    {
        await Task.Delay(1000);
    };

    private async Task ShowConfirm()
    {
        RenderFragment icon =@<Icon Type="exclamation-circle" Theme="outline"></Icon>;

        await _modalService.Confirm(new ConfirmOptions()
        {
            Title = "Do you want to delete these items?",
            Icon = icon,
            Content = "When clicked the OK button, this dialog will be closed after 1 second",
            OnOk = OnOkClick
        });
    }
}
